package com.sina.weibo;

import android.app.Dialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Editable;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.Toast;
import com.sina.weibo.models.User;

public class FillInfoActivity extends BaseActivity
{
  Button mBtCancel;
  Button mBtOkay;
  EditText mEtNickname;
  Dialog mPgDialog;
  RadioGroup mRgSex;
  FillInfoTask mTask;
  boolean mTaskFree = 1;
  User mUser;

  private void checkValid()
  {
    switch (this.mRgSex.getCheckedRadioButtonId())
    {
    default:
      this.mBtOkay.setEnabled(0);
    case 2131624002:
    case 2131624003:
    }
    while (true)
    {
      return;
      if (this.mEtNickname.getText().toString().length() < 1)
      {
        this.mBtOkay.setEnabled(0);
        continue;
      }
      this.mBtOkay.setEnabled(1);
    }
  }

  protected void handleTitleBarEvent(int paramInt)
  {
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setView(2130903053);
    Button localButton1 = (Button)findViewById(2131624005);
    this.mBtCancel = localButton1;
    Button localButton2 = this.mBtCancel;
    FillInfoActivity.1 local1 = new FillInfoActivity.1(this);
    localButton2.setOnClickListener(local1);
    Button localButton3 = (Button)findViewById(2131624004);
    this.mBtOkay = localButton3;
    Button localButton4 = this.mBtOkay;
    FillInfoActivity.2 local2 = new FillInfoActivity.2(this);
    localButton4.setOnClickListener(local2);
    EditText localEditText1 = (EditText)findViewById(2131624000);
    this.mEtNickname = localEditText1;
    EditText localEditText2 = this.mEtNickname;
    FillInfoActivity.3 local3 = new FillInfoActivity.3(this);
    localEditText2.addTextChangedListener(local3);
    RadioGroup localRadioGroup1 = (RadioGroup)findViewById(2131624001);
    this.mRgSex = localRadioGroup1;
    RadioGroup localRadioGroup2 = this.mRgSex;
    FillInfoActivity.4 local4 = new FillInfoActivity.4(this);
    localRadioGroup2.setOnCheckedChangeListener(local4);
    User localUser = (User)getIntent().getSerializableExtra("USER");
    this.mUser = localUser;
    setTitle(2131427539);
    checkValid();
  }

  class FillInfoTask extends AsyncTask<Object, Void, Boolean>
  {
    String error;

    private FillInfoTask()
    {
    }

    protected Boolean doInBackground(Object[] paramArrayOfObject)
    {
      String str1 = (String)paramArrayOfObject[0];
      int i = ((Integer)paramArrayOfObject[1]).intValue();
      try
      {
        FillInfoActivity.this.mUser.nick = str1;
        RPCHelper localRPCHelper = RPCHelper.getInstance(FillInfoActivity.this.getApplication());
        User localUser = FillInfoActivity.this.mUser;
        boolean bool = localRPCHelper.editUserInfo(localUser, i, 1);
        Boolean localBoolean1 = Boolean.valueOf(1);
        localBoolean2 = localBoolean1;
        return localBoolean2;
      }
      catch (RPCHelper.HttpException localHttpException)
      {
        while (true)
        {
          FillInfoActivity localFillInfoActivity = FillInfoActivity.this;
          Throwable localThrowable = Utils.getRootCause(localHttpException);
          String str2 = Utils.translationThrowable(localFillInfoActivity, localThrowable);
          this.error = str2;
          Boolean localBoolean2 = Boolean.valueOf(0);
        }
      }
    }

    protected void onCancelled()
    {
      FillInfoActivity.this.mTaskFree = 1;
    }

    protected void onPostExecute(Boolean paramBoolean)
    {
      FillInfoActivity.this.mTaskFree = 1;
      FillInfoActivity.this.mPgDialog.dismiss();
      if (paramBoolean.booleanValue())
      {
        Intent localIntent1 = new Intent();
        String str1 = FillInfoActivity.this.mEtNickname.getText().toString();
        Intent localIntent2 = localIntent1.putExtra("NICKNAME", str1);
        FillInfoActivity.this.setResult(-1, localIntent1);
        FillInfoActivity.this.finish();
      }
      while (true)
      {
        return;
        if (this.error != null)
        {
          FillInfoActivity localFillInfoActivity1 = FillInfoActivity.this;
          String str2 = this.error;
          Toast.makeText(localFillInfoActivity1, str2, 0).show();
          continue;
        }
        FillInfoActivity localFillInfoActivity2 = FillInfoActivity.this;
        String str3 = FillInfoActivity.this.getString(2131427542);
        Toast.makeText(localFillInfoActivity2, str3, 0).show();
      }
    }

    protected void onPreExecute()
    {
      FillInfoActivity.this.mTaskFree = 0;
      FillInfoActivity localFillInfoActivity1 = FillInfoActivity.this;
      FillInfoActivity localFillInfoActivity2 = FillInfoActivity.this;
      Dialog localDialog1 = Utils.createProgressDialog(2131427540, localFillInfoActivity2, 1);
      localFillInfoActivity1.mPgDialog = localDialog1;
      FillInfoActivity.this.mPgDialog.show();
      Dialog localDialog2 = FillInfoActivity.this.mPgDialog;
      FillInfoActivity.FillInfoTask.1 local1 = new FillInfoActivity.FillInfoTask.1(this);
      localDialog2.setOnKeyListener(local1);
    }

    protected void onProgressUpdate(Void[] paramArrayOfVoid)
    {
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.FillInfoActivity
 * JD-Core Version:    0.6.0
 */